<?php

/**
 * 查询日期是否是周几?若是,则返回true;
 * @param $week
 * @param int $day
 * @return bool
 */
function WeekVerify($week,int $day = 7)
{

    date_default_timezone_set('PRC');

    if($day < 0 || $day > 7){

        return false;

    }

    if(!is_numeric($week)){

        //看看能不能转换成时间戳
       if(!strtotime($week)){

           return false;

       }
        $week = strtotime($week);
    }


    if(date('N',$week) ==  $day){

        return true;
    }

    return  false;

}
